import Vue from 'vue'
import VueRouter, { RouteConfig } from 'vue-router'
import Layout from "../views/layout/Layout.vue"

Vue.use(VueRouter)

const routes: Array<RouteConfig> = [
  {
    path: '/',
    name: 'home',
    component: Layout,
    redirect:"/commodities",
    children:[
      {
        meta:[{index:0}],
        path:"/commodities",
        component:()=> import('../views/Commodities.vue')
      },
      {
        meta:[{index:1}],

        path:"/appraise",
        component:()=> import('../views/AppraisePage.vue')
      },
      {
        meta:[{index:2}],

        path:"/business",
        component:()=> import('../views/Business.vue')
      }
    ]
  },
  {
    path:"/detail",
    component:()=> import('../views/OrderDetail.vue')
  }
 
]

const router = new VueRouter({
  routes
})

export default router
